<?php 
$attributes = array('id' => 'add_form_oc');
echo form_open('outcome/saveoutcome/' . $idBusinessLine, $attributes); ?>
<table width="100%">
	<tr>
    	<td class="menuActual">Config > Data > Add Outcome</td>
    </tr>
    <tr>
    	<td>
        	<span id='outcome_form_msg' class="msg_error">* Required fields</span>
            <table>
			<?php
            if(!isset($outcome)) $outcome = new Outcome_dto();
            echo form_hidden('idOC', $outcome->id);
            ?>
              <tr>
                <td class="descripcionForm"><?php	echo form_label("Name: *");?></td>
                <td class="descripcionForm">
                    <?php
                    $attributes = array('id' => 'nameOC', 'rows' => '3', 'cols' => '50','name' => 'nameOC', 'maxlength' => '250', 
					'value' => (set_value('nameOC') == '' ? $outcome->name : set_value('nameOC')));
					echo form_textarea($attributes);
                    ?>
                </td>
              </tr>
              
              <tr>
                <td class="descripcionForm"><?php echo form_label("Business Line: *"); ?></td>
                <td class="descripcionForm">
                    <?php
					$opcionesBL = array();
                    if(isset($business_lines)){
						$defaultSelection = $outcome->idBusinessLine;
						foreach ($business_lines as $b_line) {
                            $nombreBL_cortado = strlen($b_line->name) > 50 ? substr($b_line->name, 0, 50) . ' (...)' : $b_line->name;
							$opcionesBL[$b_line->id] = $nombreBL_cortado;
							if($defaultSelection == 0) $defaultSelection = $b_line->id;
						}
					
						echo form_dropdown('blineoc', $opcionesBL, $defaultSelection, 'id = blineoc');
					}
                    ?>
                </td>
              </tr>
              <tr>
                    <td class="descripcionForm" colspan="2"><?php echo validation_errors(); ?></td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<?php echo form_close();?>